using System;
using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	internal class CloudQueueWrapper : ICloudQueue
	{
		private readonly CloudQueue cloudQueue;

		public CloudQueueWrapper(CloudQueue cloudQueue)
		{
			this.cloudQueue = cloudQueue;
		}

		public static implicit operator CloudQueueWrapper(CloudQueue cloudQueue)
		{
			return new CloudQueueWrapper(cloudQueue);
		}

		public static ICloudQueue Convert(CloudQueue cloudQueue)
		{
			return (CloudQueueWrapper)cloudQueue;
		}

		public void AddMessage(CloudQueueMessage message)
		{
			cloudQueue.AddMessage(message);
		}

		public CloudQueueMessage GetMessage(TimeSpan visibilityTimeout)
		{
			return cloudQueue.GetMessage(visibilityTimeout);
		}

		public void DeleteMessage(CloudQueueMessage message)
		{
			cloudQueue.DeleteMessage(message);
		}

		public CloudQueueMessage PeekMessage()
		{
			return cloudQueue.PeekMessage();
		}

		public bool CreateIfNotExist()
		{
			return cloudQueue.CreateIfNotExist();
		}

		public bool Exists()
		{
			return cloudQueue.Exists();
		}

		public void Delete()
		{
			cloudQueue.Delete();
		}
	}
}